﻿<UserControl x:Class="Chapters.Chapter11.InteractiveGardenViewPanel3DExample"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:Chapter11="clr-namespace:FSharp.Chapter11;assembly=FSharpLibrary"
			 xmlns:Resources1="clr-namespace:Chapters.Resources;assembly=Resources">
	<UserControl.Resources>

		<Resources1:StringCollection x:Key="DataSource" />

		<DataTemplate x:Key="ImageTemplate">
			<Border BorderBrush="Black"
					BorderThickness="1">
				<DockPanel>
					<Image Source="{Binding}"
						   Stretch="Fill"
						   Width="64"
						   Height="64" />
				</DockPanel>
			</Border>
		</DataTemplate>

	</UserControl.Resources>
	<DockPanel>
		<StackPanel Orientation="Horizontal"
					DockPanel.Dock="Bottom"
					Background="Gray"
					Height="35">
			<Button Click="AddItem"
					Margin="8,3,8,3"
					Width="60">Add</Button>
			<Button Click="RemoveItem"
					Margin="0,3,0,3"
					Width="60">Remove</Button>
		</StackPanel>

		<ItemsControl x:Name="_itemsControl"
					  ItemsSource="{StaticResource DataSource}"
					  ItemTemplate="{StaticResource ImageTemplate}">
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>

					<Chapter11:InteractiveGardenViewPanel3D ElementWidth="100"
															ElementHeight="100" />

				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
		</ItemsControl>
	</DockPanel>
</UserControl>